<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="__ADMIN__/css/pintuer.css">
    <link rel="stylesheet" href="__ADMIN__/css/admin.css">
    <script src="__ADMIN__/js/jquery.js"></script>
    <script src="__ADMIN__/js/pintuer.js"></script>
</head>
<body>

<div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 视频分类</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
        <ul class="search" style="padding-left:10px;">
            <li> <a class="button border-main icon-plus-square-o" href="{:url('admin/courseClass/add')}"> 添加分类</a> </li>
            <form method="post" action="">
                <li>搜索：</li>
                <li>
                    <input type="text" placeholder="请输入课件名称关键字搜索" name="video_name" class="input" style="width:250px; line-height:17px;display:inline-block" />
                    <button stype="submit" class="button border-main icon-search">搜索</button>
                </li>
            </form>
        </ul>
    </div>
    <table class="table table-hover text-center">
        <tr>
            <th>ID</th>
            <th align="left">课程名称</th>
            <th >创建时间</th>
            <th >操作</th>
        </tr>
        {volist name="lst" id="vo"}
        <tr>
            <td>{$vo.id}</td>
            <td align="left">{if condition="$vo['level'] neq 0"}|{/if}<?php echo str_repeat('-',$vo['level']*8)?>{$vo.name}</td>
            <td>{$vo.create_time}</td>
            <td><div class="button-group">
                <!--<a class="button border-main" href="{:url('admin/casedetails/info')}"><span class="icon-edit"></span> 详情</a>-->
                <a class="button border-main" href="{:url('admin/courseClass/edit',['id'=>$vo.id])}"><span class="icon-edit"></span> 修改</a>
                <!--<a class="button border-red" href="javascript:void(0)" onclick="return del(da.id})"><span class="icon-trash-o"></span> 删除</a>-->
                <a href="{:url('admin/courseClass/del',['id'=>$vo.id])}"  class="button border-red" >删除</a>
            </div></td>
        </tr>
        {/volist}
        <tr>
            <td colspan="9">

            </td>
        </tr>
    </table>
</div>

<script type="text/javascript">
    //单个删除
    function del(id){
        if(confirm("您确定要删除吗?")){
            $.ajax({
                type : "GET",
                url : "{:url('admin/video/del')}",
                data : "id="+id,
                dataType :'json',
                success:function (data) {
//                console.log(data);
                    alert(data);
                    location.reload(true);
                },
                error:function (data) {
                },
            })
        }else{
            return false;
        }
    }
</script>
</body>
</html>